<!-- $Id: goods_list.htm 17126 2010-04-23 10:30:26Z liuhui $ -->
<?php if ($this->_var['full_page']): ?>
<?php echo $this->fetch('pageheader.htm'); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?>
<!-- 商品搜索 -->
<?php echo $this->fetch('goods_search_tmp.htm'); ?>
<!-- 商品列表 -->
  <script language="javascript" type="text/javascript">

	function CPos(x, y)
	{
		this.x = x;
		this.y = y;
	}
	
	function GetObjPos(ATarget)
	{
		var target = ATarget;
		var pos = new CPos(target.offsetLeft, target.offsetTop);
		var target = target.offsetParent;
		while (target)
		{
			pos.x += target.offsetLeft;
			pos.y += target.offsetTop;
			target = target.offsetParent
		}
		return pos;
	}
	
	
	function showimg(event_obj){
		var pos = GetObjPos(event_obj);
		var obj_id = 'glass_img';
		var obj = document.getElementById(obj_id);	
		obj.style.left = parseInt(pos.x + 100)+'px';		
		obj.style.top = parseInt(pos.y - 80)+'px';	
		document.getElementById('showbigimg').innerHTML = "<img src='"+event_obj.getAttribute("bigsrc")+"' />";		
		obj.style.display = 'block';
		//clearTimeout(setTimeout(function(){obj.style.display = 'none';},3000)-1);
		
	}
	
	
</script>
<div   id="glass_img" style="position:absolute;display:none"  >
	<div style="background-image:url(images/left_big_line1.gif);width:28px;height:228px;float:left;"></div><div id="showbigimg" style="	background-color:#efefef;width:300px;height:224px;border:1px solid #80BDCB;float:left; border-left:0px;" ></div>
</div>
<form method="post" action="" name="listForm" onsubmit="return confirmSubmit(this)">
  <!-- start goods list -->
  <div class="list-div" id="listDiv">
<?php endif; ?>
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
      <a href="javascript:listTable.sort('goods_id'); "><?php echo $this->_var['lang']['record_id']; ?></a><?php echo $this->_var['sort_goods_id']; ?>    </th>
    <th><?php echo $this->_var['lang']['image']; ?></th>
    <th><a href="javascript:listTable.sort('goods_name'); "><?php echo $this->_var['lang']['goods_name']; ?></a><?php echo $this->_var['sort_goods_name']; ?></th>
    <th><a href="javascript:listTable.sort('goods_sn'); "><?php echo $this->_var['lang']['goods_sn']; ?></a><?php echo $this->_var['sort_goods_sn']; ?></th>
	  <th><a href="javascript:listTable.sort('model'); "><?php echo $this->_var['lang']['model']; ?></a><?php echo $this->_var['sort_model']; ?></th>
    <th><a href="javascript:listTable.sort('shop_price'); "><?php echo $this->_var['lang']['shop_price']; ?></a><?php echo $this->_var['sort_shop_price']; ?></th>
    <th><a href="javascript:listTable.sort('is_on_sale'); "><?php echo $this->_var['lang']['is_on_sale']; ?></a><?php echo $this->_var['sort_is_on_sale']; ?></th>

    <th><a href="javascript:listTable.sort('sort_order'); "><?php echo $this->_var['lang']['sort_order']; ?></a><?php echo $this->_var['sort_sort_order']; ?></th>
    <?php if ($this->_var['use_storage']): ?>
    <th><a href="javascript:listTable.sort('goods_number'); "><?php echo $this->_var['lang']['goods_number']; ?></a><?php echo $this->_var['sort_goods_number']; ?></th>
    <?php endif; ?>
    <th><?php echo $this->_var['lang']['handler']; ?></th>
  <tr>
  <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)):
    foreach ($_from AS $this->_var['goods']):
?>
  <tr  <?php if ($this->_var['goods']['is_mod']): ?> class='pre_tr' <?php endif; ?>  onmouseover="jQuery('.img_obj1').css('border','0px solid #ff0000');jQuery(this).find('.img_obj1').css('border','2px solid #ff0000');">
    <td  >
	
	<input type="checkbox" name="checkboxes[]" value="<?php echo $this->_var['goods']['goods_id']; ?>" /><?php echo $this->_var['goods']['goods_id']; ?></td>
    <td class="first-cell"  align="center" >
		<img src="../<?php echo $this->_var['goods']['goods_thumb']; ?>" width="100" height="80" align="center" onmouseover="showimg(this);" onmouseout="jQuery('#glass_img').hide();" bigsrc="../<?php echo $this->_var['goods']['original_img']; ?>">
	
	</td>
    <td class="first-cell" style="<?php if ($this->_var['goods']['is_promote']): ?>color:red;<?php endif; ?>"><span onclick="listTable.edit(this, 'edit_goods_name', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?></span></td>
    <td><span onclick="listTable.edit(this, 'edit_goods_sn', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo $this->_var['goods']['goods_sn']; ?></span></td>
	<td><span onclick="listTable.edit(this, 'edit_product_model', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo $this->_var['goods']['product_model']; ?></span></td>
    <td align="right"><span onclick="listTable.edit(this, 'edit_goods_price', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo $this->_var['goods']['shop_price']; ?>

    </span></td>
    <td align="center"><img src="images/<?php if ($this->_var['goods']['is_on_sale']): ?>yes<?php else: ?>no<?php endif; ?>.gif" onclick="listTable.toggle(this, 'toggle_on_sale', <?php echo $this->_var['goods']['goods_id']; ?>)" /></td>
  
    <td align="center"><span onclick="listTable.edit(this, 'edit_sort_order', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo $this->_var['goods']['sort_order']; ?></span></td>
    <?php if ($this->_var['use_storage']): ?>
    <td align="right"><span onclick="listTable.edit(this, 'edit_goods_number', <?php echo $this->_var['goods']['goods_id']; ?>)"><?php echo $this->_var['goods']['goods_number']; ?></span></td>
    <?php endif; ?>
    <td align="center">
    
      <a href="goods_tmp.php?act=view&goods_id=<?php echo $this->_var['goods']['goods_id']; ?><?php if ($this->_var['code'] != 'real_goods'): ?>&extension_code=<?php echo $this->_var['code']; ?><?php endif; ?>" title="<?php echo $this->_var['lang']['view']; ?>"><img src="images/icon_view.gif" width="16" height="16" border="0" /></a>
	  <a href="goods_tmp.php?act=edit&goods_id=<?php echo $this->_var['goods']['goods_id']; ?><?php if ($this->_var['code'] != 'real_goods'): ?>&extension_code=<?php echo $this->_var['code']; ?><?php endif; ?>" title="<?php echo $this->_var['lang']['edit']; ?>"><img src="images/icon_edit.gif" width="16" height="16" border="0" /></a>
      </td>
  </tr>
  <?php endforeach; else: ?>
  <tr><td class="no-records" colspan="11"><?php echo $this->_var['lang']['no_records']; ?></td></tr>
  <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
</table>
<!-- end goods list -->

<!-- 分页 -->
<table id="page-table" cellspacing="0">
  <tr>
    <td align="right" nowrap="true">
    <?php echo $this->fetch('page.htm'); ?>
    </td>
  </tr>
</table>

<?php if ($this->_var['full_page']): ?>
</div>

	<div align="center">
	  <input type="hidden" name="act" value="batch" />
	  <input type="hidden" name="type" value="valid" />
	  <input type="hidden" name="validresult" id="validresult" value=""/>
	  
	  <input type="submit" value="审核通过" id="btnSubmit" name="btnSubmit" class="button" disabled="true" onclick="document.getElementById('validresult').value=1;" />
	  <input type="submit" value="取消修改" id="btnSubmit1" name="btnSubmit1" class="button" disabled="true" onclick="document.getElementById('validresult').value=2;"  />
	</div>
</form>

<script type="text/javascript">
  listTable.recordCount = <?php echo $this->_var['record_count']; ?>;
  listTable.pageCount = <?php echo $this->_var['page_count']; ?>;

  <?php $_from = $this->_var['filter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
  listTable.filter.<?php echo $this->_var['key']; ?> = '<?php echo $this->_var['item']; ?>';
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>

  
  onload = function()
  {
    startCheckOrder(); // 开始检查订单
    document.forms['listForm'].reset();
  }

  /**
   * @param: bool ext 其他条件：用于转移分类
   */
  

  function changeAction()
  {
      var frm = document.forms['listForm'];

      // 切换分类列表的显示
      frm.elements['target_cat'].style.display = frm.elements['type'].value == 'move_to' ? '' : 'none';
			
			<?php if ($this->_var['suppliers_list'] > 0): ?>
      frm.elements['suppliers_id'].style.display = frm.elements['type'].value == 'suppliers_move_to' ? '' : 'none';
			<?php endif; ?>

      if (!document.getElementById('btnSubmit').disabled &&
          confirmSubmit(frm, false))
      {
	     frm.submit();
      }
	  if (!document.getElementById('btnSubmit1').disabled &&
          confirmSubmit(frm, false))
      {
          frm.submit();
      }
  }

</script>
<?php echo $this->fetch('pagefooter.htm'); ?>
<?php endif; ?>